Algorithm W Step by Step